//
//  UserInfoItem.h
//  SquashSpark
//
//  Created by Coollang on 2017/11/6.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import <Realm/Realm.h>


@interface JCClubIDString : RLMObject

@property NSString *clubID;
+ (JCClubIDString *)clubIDStringWithPrivateKey:(NSString *)key;

@end
RLM_ARRAY_TYPE(JCClubIDString)






@interface UserInfoItem : RLMObject

@property  NSString *userId;               //userID

@property  NSString *icon;                 //头像URL
@property  NSString *lastName;             //姓
@property  NSString *FirstName;            //名
@property  NSString *signature;            //签名
@property  Gender gender;                  //性别
@property  NSString *email;                //邮件
@property  NSString *passWord;             //md5加密后的密码
@property  NSString *weight;               //体重 单位 kg
@property  NSString *height;               //身高:单位 m(米)
@property  NSString *birthYear;            //出生年份:1990
@property  NSString *address;              //地址
@property  HandDirectionType handBallType; //左右手
@property  RacquetType racquetType;        //球拍类型
@property  NSString *trainingTarget;       //训练目标
@property  LoginType loginType;            //登录方式
@property  BOOL equipmentCalibration;            //设备是否校验

@property  NSString *countryID;            //国家ID
@property  NSString *provinceID;           //省份ID
@property  NSString *cityID;               //城市ID
@property  NSString *phoneNum;             //电话
@property  NSString *createTime;           //账号创建时间
@property  NSString *updateTime;           //最后一次更新时间
@property  NSString *lastLoginVersion;     //最后一次登录版本

@property RLMArray <JCClubIDString *> <JCClubIDString> *joinClubs;
@property RLMArray <JCClubIDString *> <JCClubIDString> *adminClubs;

+ (UserInfoItem *)userInfoWithPrivateKey:(NSString *)key;

// 将数据替换成userInfo的值,并存储
- (void)copyValuesFrom:(UserInfoItem *)userInfo;
- (void)copyValuesTo:(UserInfoItem *)infoParams;

- (void)parseUserInfoDictionary:(NSDictionary *)dict;
// 根据年龄获取是那一年出生的
- (NSInteger)getAge;

- (NSString *)nickName;

// 升高快速 英寸和英尺快速转换方法
- (NSInteger)ftFormHeight;
- (CGFloat)inchFormHeight;
+ (NSString *)ft:(NSInteger)ft inch:(NSInteger)inch;

/*判断俱乐部类型*/
- (ClubUserType)clubUserType:(NSString *)clubID;
- (ClubUserType)clubUserType;

@end
RLM_ARRAY_TYPE(UserInfoItem)
